import axios from 'axios';
import type { AxiosResponse } from 'axios';

export interface ChargingPileEnableParams {
  enabled: number;
}

export interface ApiResponse<T = any> {
  code: number;
  data: T;
  message: string;
}

/**
 * 更新充电桩启用状态
 * @param id 充电桩ID
 * @param params 参数
 */
export function updatePileEnabled(id: number, params: ChargingPileEnableParams): Promise<ApiResponse> {
  return axios.put(`/api/charging/pile/enable/${id}`, params).then(res => res.data);
} 